package inits

import (
	"github.com/elastic/go-elasticsearch/v7"
	"log"
)

func InitEs() {
	var err error
	es := Config.Es
	cfg := elasticsearch.Config{
		Addresses: []string{
			es.Address,
		},
	}
	Es, err = elasticsearch.NewClient(cfg)
	if err != nil {
		log.Println("es 连接失败")
	}
	log.Println("es 连接成功")
}
